﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;

namespace KM.Areas.ADMIN.Controllers
{
    public class ReadOnlyLogOnAttribute : FilterAttribute, IAuthorizationFilter
    {
        public void OnAuthorization(AuthorizationContext filterContext)
        {
            if (HttpContext.Current.Session["UserId"] == null)
            {
                var controller = new ControllerBase();
                filterContext.Result = controller.RedireToLogin();
            }
        }


    }
}